'use strict';

/**
 * @param {Egg.Application} app - egg application
 */
module.exports = app => {
  //middleware 是中间件，就是能用到我们上面的方法
  const { router, controller } = app;

  router.get('/user/info', controller.user.getInfo);
  router.post('/login', controller.user.login);
  router.get('/users', controller.user.getUsers);
  router.get('/ps/info', controller.user.getPsInfo);
  router.post('/user/permission', controller.user.modifyUserPermission);

  router.post('/check/file', controller.upload.checkFile)
  router.post('/upload', controller.upload.upload)
  router.post('/merge/file', controller.upload.mergeFile)
  router.get('/files', controller.fileList.filesList)
  router.delete('/file/:id', controller.fileList.deleteFile)
};
